﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Content;

namespace Homebound
{
    public class State
    {
        public List<string> choices;
        public List<bool> access;
        public int selectedChoice;
        protected GraphicsDeviceManager graphics;
        protected GameServiceContainer services;
        protected ContentManager content;
        public bool enterPressed;
        public Planets planets;

        public State(GraphicsDeviceManager newGraphics, GameServiceContainer newServices, ContentManager newContent)
        {
            selectedChoice = 0;
            choices = new List<string>();
            access = new List<bool>();
            graphics = newGraphics;
            services = newServices;
            content = newContent;
            enterPressed = false;
            planets = new Planets(graphics, content, this);
        }

        // Load all content for the current state.
        public virtual void loadContent()
        {
        }

        // Called whenever a new state is selected.
        public virtual void onEnter(State state)
        {
            loadContent();
        }

        // Called when the state is changing.
        public virtual void onExit(State state)
        {
        }
      
        public virtual void draw(SpriteBatch spriteBatch, GameTime gameTime, Vector2 screenSize)
        {
        }

        // Handles all input for the current state, (Keyboard, GamePad).
        public virtual void input(GameTime gameTime, List<Keys> keys, GamePadButtons buttons, GamePadDPad dpad, GamePadThumbSticks thumbSticks)
        {
        }

        // Handles all update operations for the current state, (Keyboard, GamePad).
        public virtual void update(GameTime gameTime)
        {
        }

        // Conditions necessary to enter go return to a previous state.
        public virtual bool goingBack(State next)
        {
            return true;
        }

        // Conditions necessary to enter to go a following state.
        public virtual bool goingForward(State prev)
        {
            return true;
        }
    }
}
